#define BIT_AUTOVOICE 1
#define BIT_AUTOOP 2
#define BIT_AUTOKICK 4


typedef struct _authlist authlist;
struct _authlist
{
  char *nick;
  char *mask;
  int level;
  authlist *next;
  authlist *prev;
};

typedef struct _chanlist chanlist;
struct _chanlist
{
  char *nom;
  authlist *auth_head;
  byte flag;
  chanlist *next;
};

void send_auth_error (msg * i, byte type);
void _auth_add_auth (msg * i, int l, int modes);
void _auth_add_channel (char *nom, int modes);
chanlist *_auth_get_channel (char *nom);
authlist *_auth_get_auth_by_mask (chanlist * c, char *n);
authlist *_auth_get_auth_by_name (chanlist * c, char *n);
void _auth_del_auth_by_ptr (chanlist * c, authlist * a);
void _auth_del_channel_by_ptr (chanlist * p);
void auth_init_link (void);
int _auth_is_auth (char *ch, char *nm);
unsigned int _auth_get_sid (void);
void init_chan_map (void);

extern chanlist *chan_head;
extern unsigned int auth_sid;

enum
{ NO_CHANNEL, BAD_MASK, BAD_PASS, SUSPEND, BAD_REQUEST, NO_AX, INVALID_AX };
